package cn.xuqiudong.backend.module.system.user.model;

import cn.xuqiudong.common.base.model.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * 系统用户表 实体类
 *
 * @author Vic.xu
 */
public class SysUser extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 昵称
     */
    private String nickname;
    /**
     * 登录名
     */
    private String username;
    /**
     * 头像 对应附件表id
     */
    private Integer avatar;
    /**
     * 密码
     */
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private String password;
    /**
     * 性别 0-保密 1-男2-女
     */
    private Integer gender;
    /**
     * 生日
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")

    private Date birthday;
    /**
     * 邮箱
     */
    private String email;
    /**
     * 电话
     */
    private String phone;

    /***************** set|get start **************************************/

    /**
     * set：昵称
     */
    public SysUser setNickname(String nickname) {
        this.nickname = nickname;
        return this;
    }

    /**
     * get：昵称
     */

    public String getNickname() {
        return nickname;
    }

    /**
     * set：登录名
     */
    public SysUser setUsername(String username) {
        this.username = username;
        return this;
    }

    /**
     * get：登录名
     */

    public String getUsername() {
        return username;
    }

    /**
     * set：头像 对应附件表id
     */
    public SysUser setAvatar(Integer avatar) {
        this.avatar = avatar;
        return this;
    }

    /**
     * get：头像 对应附件表id
     */

    public Integer getAvatar() {
        return avatar;
    }

    /**
     * set：密码
     */
    public SysUser setPassword(String password) {
        this.password = password;
        return this;
    }

    /**
     * get：密码
     */

    public String getPassword() {
        return password;
    }

    /**
     * set：性别 0-保密 1-男2-女
     */
    public SysUser setGender(Integer gender) {
        this.gender = gender;
        return this;
    }

    /**
     * get：性别 0-保密 1-男2-女
     */

    public Integer getGender() {
        return gender;
    }

    /**
     * set：生日
     */
    public SysUser setBirthday(Date birthday) {
        this.birthday = birthday;
        return this;
    }

    /**
     * get：生日
     */

    public Date getBirthday() {
        return birthday;
    }

    /**
     * set：邮箱
     */
    public SysUser setEmail(String email) {
        this.email = email;
        return this;
    }

    /**
     * get：邮箱
     */

    public String getEmail() {
        return email;
    }

    /**
     * set：电话
     */
    public SysUser setPhone(String phone) {
        this.phone = phone;
        return this;
    }

    /**
     * get：电话
     */

    public String getPhone() {
        return phone;
    }
    /***************** set|get end **************************************/
}
